package com.spring.springmvc.请求.传参;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RequestMapping("/file")
@RestController
public class 上传文件 {
    @RequestMapping("/r1")
    public String receive(@RequestPart("file") MultipartFile img){
        String fileName = img.getOriginalFilename();
        return "文件名称："+fileName;
    }
}
